home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Hyper / M-Md / MacUser.cpt / MacUser MiniFinders / stack_-1.xml < prev    next >
Extensible Markup Language  |  1990-07-05  |  12KB  |  16 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
  3. <stack>
  4.     <name>in</name>
  5.     <id>-1</id>
  6.     <cardCount>663</cardCount>
  7.     <cardID>3888</cardID>
  8.     <listID>79893</listID>
  9.     <cantModify><false /></cantModify>
  10.     <cantDelete><false /></cantDelete>
  11.     <cantAbort><false /></cantAbort>
  12.     <cardSize>
  13.         <width>512</width>
  14.         <height>342</height>
  15.     </cardSize>
  16.     <script>-------------------------------------------------------------------------- Minifinder Stack scripts by David Drucker-- Special Thanks to Jeremy Ahouse and Steven Drucker-- colorRectProgress XCMD by Jeremy Ahouse-- PopUpMenu XFCN from "101 Buttons and Scripts"-- FileName XFCN by Eric Carlson and Anup Murarka of Apple Computer------------------- List of Functions and Handlers : --------------------- on openStack-- on doPopUpTOCMenu-- function FormattedQuery-- function findWhatWhere theQuery-- function otherChecks theQuery-- function nextNonEmptyItem  someItems,startPoint-- function fieldNamefrom ItemNumber-- function checkEveryWhere string-- function mouseCheck theQuery-- function QueryIsGood-- function posNumber string-- function abortSearch-- function clickLine-- function numericEquivalent aValue-- function mouseEquivalent aValue-- on showList theList-- on hideList theList-- function permission toDoWhat-- function padLeft whatToPad, finalLength-- on import-- on deleteOldCards-- on clearFields-- on importText-- on startProgress-- on progressOver-- function progressRect-- on refresh------------------------------------------------------------------------on openStackhide menubarGLOBAL TOCMenu--initialize Table of Contents Menuput cd fld TOCMenuItems of cd 1 into TOCMenupass openStackend openStackon doPopUpTOCMenuGLOBAL TOCMenuput the ticks into DownStartput TOCMenu into theMenuItemsset cursor to arrowget PopUpMenu (TOCMenu, 0,left of the target+1,bottom of the target)if the ticks - DownStart < 15 and it = 0 thenanswer "Hold button down longer to view menu." with "OK"else if it ‚↠"0" thenif it = 1 thengo cd Contentsexit doPopUpTOCMenuend iflock screengo bg datafind (item it of theMenuItems) in fld subjectunlock screen with visual effect zoom openend ifend doPopUpTOCMenu-- begin functions connected with multi-keyed find:-- Function to convert the input fields on card findCard into-- a list of items that will be used in MultiFindfunction FormattedQueryput cd fld productName into item 1 of theQueryput cd fld companyName into item 2 of theQueryif the short name of cd btn id 21 = "Any" thenput empty into item 3 of theQueryelse put the short name of cd btn id 21 into item 3 of theQueryput cd fld wordsAnyWhere into item 4 of theQueryput cd fld mouseLogic into item 5 of theQueryput cd fld mouseRating into item 6 of theQueryreturn theQueryend FormattedQuery--  returns a find command corresponding to what field the string should--  be searched (4 is "words anywhere" so no field is specified)function findWhatWhere theQueryput empty into findStringrepeat with i = 1 to 4if item i of theQuery = "" then next repeatput item i of theQuery into findStringput i into whichFieldNumberexit repeatend repeatif findString = "" then return emptyput "Product,Company name,Subject" into fieldListif whichFieldNumber = "4" then return "find" && quote & findstring & quoteelse return "find" && quote & findString & quote && "in fld" &&¬¨quote & item whichFieldNumber of fieldList & quoteend findWhatWhere-- Will be called to do a series of "if field xxx contains yyy" checks.-- These will be executed until it passes all tests. Any failure exits-- the function with a false value immediately.-- The trickiest is 'words anywhere', which checks all fields-- on the card, via another function, called checkEveryWhere.function otherChecks theQuery-- find second non empty itemput nextNonEmptyItem(theQuery,0) into FirstFoundnotEmptyif FirstFoundnotEmpty = "" then return trueput nextNonEmptyItem(theQuery,FirstFoundnotEmpty) into startingItemif startingItem = "" then return trueif startingItem = 5 then return truerepeat with i = startingItem to 4if item i of theQuery = "" then next repeatif i = 4 thenif checkEveryWhere (item 4 of theQuery) = false thenreturn falseend ifelseput "Put"&&(fieldNamefrom(i) && "contains" && ¬¨quote & (item i of theQuery) & quote) ¬¨&& "into OKsoFar" into LogicExprdo LogicExprif OKSoFar = false thenreturn falseend ifend ifend repeatreturn trueend otherChecks-- returns the next non-empty item in a list of itemsfunction nextNonEmptyItem  someItems,startPointrepeat with i = startPoint + 1 to the number of items of someItemsif item i of someItems ‚↠"" then return iend repeatreturn emptyend nextNonEmptyItem-- returns a Field Name corresponding to the itemNumber (for creating-- 'contains' commands)function fieldNamefrom ItemNumberif itemNumber > 3 or itemNumber < 1 then return emptyput "Product,Company name,Subject" into listOfFieldNamesreturn "field" && quote & item ItemNumber of listOfFieldNames & quoteend fieldNamefrom-- returns true if string is found anywhere on the cardfunction checkEveryWhere stringrepeat with i = 1 to the number of fieldsif fld i contains string thenreturn trueexit repeatend ifend repeatreturn falseend checkEveryWhere-- checks for if mice in numericMice field match query specification-- if no mice are specified in the query, it will return truefunction mouseCheck theQueryif item 6 of theQuery = "" then return trueput item 5 of theQuery into mouseLogicif field numericMice = "" then return false -- in case of a blank carddo "put" && (field numericMice && mouseLogic && item 6 of theQuery) && "into passed"return passedend mouseCheck-- checks for valid values in the fields. Returns the problem field's-- namefunction QueryIsGoodif posNumber(cd fld mouseRating) is false and cd fld mouseRating ‚↠"" then return "mouse"return emptyend QueryIsGood-- returns true or false for a positive number-- notice that +5 is a positive number, so posNumber returns true for-- this (admittedly odd) casefunction posNumber anyStringput "0123456789." into theDigitsput char 1 of anyString into signDigitif not (theDigits contains signDigit) AND (signDigit ‚↠"+") then return FALSEput false into hitOncerepeat with ndx = 2 to length(anyString)if char ndx of anyString = "."  and hitOnce is true then return FALSEif not (theDigits contains char ndx of anyString) then return FALSEif char ndx of anyString = "." then put true into hitOnceend repeatreturn TRUEend posNumber-- for aborting searches (or imports)function abortSearchanswer "Do you want to stop?" with "No" or "Yes"if it is "Yes" thenreturn trueend ifreturn falseend abortSearch---- (end of functions connected with multi-keyed find)-- returns line number clicked on of any fieldfunction clickLineif the style of the target = "scrolling" thenreturn ((item 2 of the clickLoc - top of target-4+scroll of target) ¬¨div textheight of target) + 1else-- clickLine for non-scrolling fieldsreturn ((item 2 of the clickLoc - top of target - 4) ¬¨div textheight of target) + 1end ifend clickLine-- returns numeric equiv of mice fldsfunction numericEquivalent aValueput (number of chars in aValue - 1) into Ratingif charToNum(char (number of chars in aValue ) of aValue ) = 217 thenadd .5 to Ratingelse add 1 to Ratingreturn Ratingend numericEquivalent-- returns the mouseField for a numeric valuefunction mouseEquivalent aValueif aValue ‚⧠0 then return emptyif aValue < 1 then return numToChar(217)put char 1 of aValue into howManyTimesrepeat howManyTimesput numToChar(219) after Ratingend repeatif the number of characters in aValue > 1 then put numToChar(217) after Ratingreturn Ratingend mouseEquivalent-- shows all items in liston showList theListrepeat with i = 1 to the number of items in theListshow item i of theListend repeatend showList-- hides all items in liston hideList theListrepeat with i = 1 to the number of items in theListhide item i of theListend repeatend hideList-- for standard Mac "are you sure" Dialogfunction permission toDoWhatanswer "Are you sure you want to" && toDoWhat & "?" with "OK" or "Cancel"return itend permission--  Pad the left of "whatToPad" to make a string "finalLength"--  characters long (a maximum of 120 blanks will be added to the--  string).function padLeft whatToPad, finalLengthput finalLength - length(whatToPad) into paddingAmountif paddingAmount > 0 thenput "                                                            " & ¬¨"                                                            " ¬¨into paddingText  -- a string of 120 spacesput char 1 to paddingAmount of paddingText before whatToPadend ifreturn whatToPadend padLeft-- handler for importing new data into MiniFinderson importset the userlevel to 5answer "Import new Data?" with "OK" or "Cancel"if it is "Cancel" then exit importanswer "Append data or replace?" with "Append" or "Replace" or "Cancel"if it is "Cancel" then exit importstartProgresslock screenif it is "Replace" thenif permission ("trash all old data") is "Cancel" thenexit importend ifdeleteOldCardsend iflock screenput fileName()into fileNameimportText fileNamego card findCardprogressOverdoMenu "Compact Stack"unlock screenanswer "Done!" with "Finally"end import-- deletes all old cardson deleteOldCardsput the number of cards in bg data into totalput true into alltheWayput progressRect() into pRectgo card 1 of bg dataclearFieldsput true into alltheWaygo next cardrepeat with i = 2 to totaldoMenu "Delete Card"go cd 2 of bg datacolorRectProgress pRect,i,total,blueif the mouseClick thenif abortSearch() is true thenput false into alltheWayexit repeatend ifend ifend repeatif alltheWay is true thencolorRectProgress pRect,total,total,blueend ifgo card findCardunlock screenend deleteOldCardson clearFieldsrepeat with i = 1 to the number of fldsput empty into fld iend repeatend clearFieldson importText fileNameput true into alltheWayput 500 into total -- expecting around 500 to importput progressRect() into pRectgo to last card of bg dataopen file fileNameput 1 into counterrepeatset cursor to busyadd 1 to countercolorRectProgress pRect,counter,total,blueread from file fileName until tabif it is empty then exit repeatdelete last char of itput it into fld "Subject"read from file fileName until tabdelete last char of itput it into fld "Product"read from file fileName until tabdelete last char of itput word 1 of it into fld "numericMice"put mouseEquivalent(word 1 of it) into fld "Mice"read from file fileName until tabdelete last char of itput it into fld "Descript"read from file fileName until tabdelete last char of itput it into fld "Company Name"read from file fileName until tabdelete last char of itput it into fld  "St Address"read from file fileName until tabdelete last char of itput it into fld  "City"read from file fileName until tabdelete last char of itput it into fld  "Phone"read from file fileName until tabdelete last char of itput it into fld  "Date Reviewed"read from file fileName until tabdelete last char of itput it into fld "Version Shipping"read from file fileName until tabdelete last char of itput it into fld "Price"read from file fileName until returndelete last char of itput it into fld "Eddy"if the mouseClick thenif abortSearch() is true thenput false into alltheWaygo cd findCardexit repeatend ifend ifdoMenu "New Card"end repeatif alltheWay is true thencolorRectProgress pRect,total,total,blueend ifclose file fileNameend importText-- shows the progress bar itemson startProgressshowList "cd btn bar, cd btn progressPad, cd fld progressField"end startProgress-- hides the progress bar items and clears the screen of any lingering-- ephemeral images from the colorRectProgress XCMDon progressOverhideList "cd btn bar, cd btn progr